<script>
import store from "@/store/index.js";
export default {
	onLaunch(){
		uni.getSystemInfo({
			success(e){
				// console.log(e,"=======");
				let statusHeight,navHeight;
				let menuButtonOffset = 0,menuButtonHeight = 0;
				// #ifndef MP
				statusHeight = e.statusBarHeight; //手机状态栏高度
				if(e.platform == "android"){
					navHeight = e.statusBarHeight + 50; //导航栏高度
				}else{
					navHeight = e.statusBarHeight + 45; //导航栏高度
				};
				// #endif
				
				// #ifdef MP-WEIXIN
				statusHeight = e.statusBarHeight; //手机状态栏高度
				let menuButtonObjInfo = wx.getMenuButtonBoundingClientRect();
				menuButtonOffset = menuButtonObjInfo.top - statusHeight; //右侧胶囊距离状态栏的距离
				menuButtonHeight = menuButtonObjInfo.height; //右侧胶囊的高度
				navHeight = menuButtonObjInfo.bottom + menuButtonObjInfo.top - e.statusBarHeight; //导航栏高度
				// #endif
				
				// #ifdef MP-ALIPAY
				statusHeight = e.statusBarHeight; //手机状态栏高度
				navHeight = e.statusBarHeight + e.titleBarHeight; //导航栏高度
				// #endif
				
				// console.log(statusHeight,navHeight);
				store.commit("setNavObjInfo",{
					statusHeight,
					navHeight,
					menuButtonOffset,
					menuButtonHeight
				});
				store.commit("setFooterObjInfo",{
					safeAreaHeight:e.safeAreaInsets.bottom
				});
				store.commit("setDeviceObjInfo",{
					osName:e.osName
				});
			}
		});
	}
}
</script>

<style lang="scss">
/*每个页面公共css */
@import '@/uni_modules/uni-scss/index.scss';
/* #ifndef APP-NVUE */
@import '@/static/customicons.css';
// 引入uv-ui基础样式
@import '@/uni_modules/uv-ui-tools/index.scss';
// 设置整个项目的背景色
page {
	background-color: var(--qilin-bg-color-default);
	height:100%;
	width:100%;
	color:var(----qilin-text-color-default);
	font-size:$default-text-size;
	font-family:$font-family;
}
// view,text{
// 	color:$normal-text-color;
// }

/* #endif */
.example-info {
	font-size: 14px;
	color: #333;
	padding: 10px;
}
</style>
